<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工程进度查询并确认</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css" media="all">
    <style>
        /*.layui-form-pane .layui-input-block{margin-left: 82px;}*/
        .saixuan:after{width: 0;}
        .layui-form-pane .layui-input-block{margin-left: 0;}
        .layui-form-item{clear: none;}

        .layui-form-item .layui-input-inline{width: 165px;}
        .masksx .forms{padding-left: 0;text-align: center;}
        .masksx{width: 650px;}
        .mask input{width: 100%!important;}
        .mask .layui-select-title{width: 480px;}
        .layui-input-block,.layui-input-inline{width: 80%;}
        .layui-input-inline{width: 80%!important;}
        .layui-inline{margin-bottom: 0;}
        .layui-upload{ text-align: left;}
        #demo2 img{width: 120px; height: 120px;}
        .imgs{position: relative;width: 120px; height: 120px; float: left;}
        ._ingshan{position: absolute;right: 0px;top: 0px;border: 1px solid #E3e3e3;
            border-radius: 50%;width: 20px;height: 20px;text-align: center;}
        @media only screen and (min-width: 321px) and (max-width: 1024px) {
            .layui-form-pane .layui-form-label{width: 108px;}
            .layui-input-inline{width: 95%;}
            .layui-input-block{width: 95%;}
            .mask .layui-input-inline{width:auto;}
            .layui-form-item .layui-input-inline{width: 95%;}
        }
        .chakan{display: none;}
        .chakan input{width: 83%!important;}
        .dynamic li:before{content: "";}
        .dynamic{text-align: left;}
        .dynamic li{text-align: center; height: 30px;line-height: 30px;}
        .GLeft{width: 100px;display: inline-block;text-align: right; padding-right: 10px;}
        .masksx{height: 50%;text-align: center;}
        .GLeft,.GRight{width: 45%;display: inline-block;}
        .GRight{text-align: left;width: 45%;}
        /*.layui-unselect .layui-form-select{width: 95%;}*/
        .layui-table-cell{ height: 32px;}
        li:before{content:'';}

        .dongkong{margin-top: 10px;}
        .layui-tab-title .layui-this{color: #fff;background-color: #009688;}
        .layui-form{height: auto!important;}

    </style>



</head>
<body>

<form class="layui-form layui-form-pane" id="form_7grid" action="" >
    <div class="formTop layui-row">
        <div class="layui-form-item layui-col-lg3 layui-col-md3  layui-col-xs3">
            <div class="layui-input-inline">
                <input type="text" name="proName"  placeholder="项目名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-col-lg3 layui-col-md3  layui-col-xs3">
            <div class="layui-input-inline">
                <input type="text" name="ccode"  placeholder="申请单位" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-col-lg3 layui-col-md3  layui-col-xs3 dongXian">
            <div class="layui-input-inline">
                <input type="text" name="cccode"  placeholder="合同单号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-col-lg3 layui-col-md3  layui-col-xs3 dongXian">
            <div class="layui-input-inline">
                <input type="text" name="sbr"  placeholder="申请人" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline layui-col-lg3 layui-col-md3 layui-col-xs3 dongkong dong1">
            <div class="layui-input-inline">
                <input type="text" name="bengintime" class="layui-input" id="test-limit3" placeholder="请选择申报开始日期">
                <div class="icons">

                </div>
            </div>
        </div>
        <div class="layui-inline layui-col-lg3 layui-col-md3 layui-col-xs3 dongkong dong1">
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="endtime" id="test-limit4" placeholder="请选择申报结束日期">
                <div class="icons">

                </div>
            </div>
        </div>

        <div class="layui-col-lg3 layui-col-md3 layui-col-xs3 dongkong dong1 layui-btn-group" style="text-align: left;">

            <button class="layui-btn tijiao" type="button" onclick="query()" >查询
            <button class="layui-btn tijiao" type="button" onclick="checkTab()" >核验单
            </button>
        </div>

    </div>
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this mingxi">明细</li>
            <li class="huizhong">汇总</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show"> <table id="demo" lay-filter="test"></table>
                <a class="dayin" type="button" id="dlink"  style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></a>

            </div>
            <div class="layui-tab-item">
                <table id="demo1" lay-filter="test"></table>
            </div>
        </div>
    </div>

    <div id="demo7"></div>

    <script type="text/html" id="barDemo">
        <button type="button" class="layui-btn layui-btn-sm shenhe quanxian" lay-event="toExamine" QX="api/process/buildProcessVali.do">审核</button>
    </script>


</form>

<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>

<script>

    function checkTab() {
        layui.use(['form', 'layedit', 'laydate','table','element'], function() {
            layer.open({
                type: 2,
                title: '核验单',
                maxmin: 'true',
                shadeClose: true,
                area: ['520px', '340px'], //宽高
                shade: 0.8,
                content: urls + '/ureport/preview?_u=file:jindu.ureport.xml' //iframe的url
            });
        });
    }

    function query() {
        layui.use(['form', 'layedit', 'laydate','table','element','upload'], function() {
            var form = layui.form
                , table = layui.table
                ,upload = layui.upload;

            var cccode=$('[name="cccode"]').val();
            var ccode=$('[name="ccode"]').val();
            var sbr=$('[name="sbr"]').val();
            var proName=$('[name="proName"]').val();
            var bengintime=$('[name="bengintime"]').val();
            var endtime=$('[name="endtime"]').val();


            $('#form_7grid').attr('action',urls+'/api/contract/conValiList.do')
            if(!AntiSqlValid(proName)){           //判断是否包含特殊符号
                if(lbq('api/process/buildProcessNew.do')) {

                    API.gongchengjinduchaxun({
                        'type': 'a',
                        'proName': proName,
                        'sbr': sbr,
                        'remark': ccode,
                        'cccode': cccode,
                        'bengintime': bengintime,
                        'endtime': endtime,
                        'p': getCookie('yanzheng')
                    })
                }
                if(lbq('api/process/buildProcessNew.do')) {

                    API.progress1({
                        'type': 'd',
                        'remark': ccode,
                        'bengintime': bengintime,
                        'endtime': endtime,
                        'proName': proName,
                        'sbr': sbr,
                        'p': getCookie('yanzheng')
                    });
                }
            }else {
                layer.msg('请勿输入特殊符号');
            };
        })

    }


    layui.use(['form', 'layedit', 'laydate','table','element','upload'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table=layui.table
            ,element=layui.element
            ,upload = layui.upload;
        var _picurls=new Array();
        jiazais();

        $('.huizhong').click(function () {
            $('.dongXian').hide();
            $('.dong1').removeClass('dongkong');
        });
        $('.mingxi').click(function () {
            $('.dongXian').show();
            $('.dong1').addClass('dongkong');

        });
        dayintishi('.dayin');

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';        //代替另一个对象调用一个方法。call 方法可将一个函数的对象上下文从初始的上下文改变为由 thisObj 指定的新对象。
        });
        if(lbq('api/process/buildProcessNew.do')){
            API.gongchengjinduchaxun({'type':'a','p':getCookie('yanzheng')});
        }

        if(lbq('api/process/buildProcessNew.do')) {
            API.progress1({'type': 'd', 'p': getCookie('yanzheng')});
        }



        //前后若干天可选，这里设置不能选过去的日期      最远可选1000天之后
        panduanshijiantow('#test-limit3','#test-limit4',1000,1000,'.tijiao');     //查询 开始结束时间判断

        $('.shenqingvisa').click(function () {
            $('.mask').show();
            $('.shenqing').show();
            $('.chakan').hide();
            $('.titleL').html('申报施工进度');


        })

        $('.close').click(function () {     //遮罩层隐藏
            $('.mask').hide();
        })
        //监听工具条
        table.on('tool(test)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值
            var tr = obj.tr; //获得当前行 tr 的DOM对象

            if(layEvent === 'detail'){ //查看
                //do somehing
                //console.log(obj)
            }else if( layEvent==='toExamine'){      //编辑
                //console.log(obj)
                /*ajaxs('/api/process/buildProcessVali.do','post',{'bt_id':obj.data.bt_id,'bt_Vali':'0','p':getCookie('yanzheng')},function (data) {
                    //console.log(data)
                    layer.msg(data.msg);
                    setTimeout(function () {
                        location.reload();
                    },1000)
                })*/

                layer.prompt({
                    formType: 2,
                    value: '',
                    title: '请输入备注'
                }, function(value, index, elem){
                    layer.msg('得到了'+value);
                    layer.close(index);
                });
            }
        });


        $(document).on('click','._ingshan',function () {
            //console.log($(this).prev().attr('src'))
            var shanSRC=$(this).prev().attr('src');
            $(this).parent().remove();
            $.each(_picurls,function(index,item){       //删除功能
                // index是索引值（即下标）   item是每次遍历得到的值；
                if(item==shanSRC){
                    _picurls.splice(index,1);
                }

            });

            //console.log(_picurls)
        })


    })

</script>
</body>
</html>